import { get, post } from '@/utils/request'
import { MenuRequest, MenuResponse } from '@interface'

// 获取路由列表
export const queryRoutes = (params: { permission: number }) => {
  return get<MenuResponse[]>('/menu/list', params)
}

// 获取打印路由列表
export const queryPrintRoutes = () => {
  return get<MenuResponse[]>('/menu/printList')
}

// 新增路由
export const addRoute = (params: MenuRequest) => {
  return post('/menu/add', params)
}

// 编辑路由
export const updateRoute = (params: MenuRequest) => {
  return post('/menu/update', params)
}

// 删除路由
export const removeRoute = (params: { id: number }) => {
  return post('/menu/remove', params)
}
